
QL_TEST_SRCS = \
	quantlibtestsuite.cpp \
	americanoption.cpp \
	amortizingbond.cpp \
	andreasenhugevolatilityinterpl.cpp \
	array.cpp \
	asianoptions.cpp \
	assetswap.cpp \
	autocovariances.cpp \
	barrieroption.cpp \
	binaryoption.cpp \
	basismodels.cpp \
	basisswapratehelpers.cpp \
	basketoption.cpp \
	batesmodel.cpp \
	bermudanswaption.cpp \
	blackdeltacalculator.cpp \
	blackformula.cpp \
	bondforward.cpp \
	bonds.cpp \
	brownianbridge.cpp \
	businessdayconventions.cpp \
	calendars.cpp \
	callablebonds.cpp \
	capfloor.cpp \
	capflooredcoupon.cpp \
	cashflows.cpp \
	catbonds.cpp \
	cdo.cpp \
	cdsoption.cpp \
	chooseroption.cpp \
	cliquetoption.cpp \
	cms.cpp \
	cmsspread.cpp \
	commodityunitofmeasure.cpp \
	compiledboostversion.cpp \
	compoundoption.cpp \
	convertiblebonds.cpp \
	covariance.cpp \
	creditdefaultswap.cpp \
	creditriskplus.cpp \
	crosscurrencyratehelpers.cpp \
	currency.cpp \
	curvestates.cpp \
	dates.cpp \
	daycounters.cpp \
	defaultprobabilitycurves.cpp \
	digitalcoupon.cpp \
	digitaloption.cpp \
	distributions.cpp \
	dividendoption.cpp \
	doublebarrieroption.cpp \
	doublebinaryoption.cpp \
	europeanoption.cpp \
	everestoption.cpp \
	exchangerate.cpp \
	extendedtrees.cpp \
	extensibleoptions.cpp \
	fastfouriertransform.cpp \
	fdheston.cpp \
	fdcir.cpp \
	fdmlinearop.cpp \
	fdcev.cpp \
	fdsabr.cpp \
	fittedbonddiscountcurve.cpp \
	forwardoption.cpp \
	forwardrateagreement.cpp \
	functions.cpp \
	garch.cpp \
	gaussianquadratures.cpp \
	gjrgarchmodel.cpp \
	gsr.cpp \
	hestonmodel.cpp \
	hestonslvmodel.cpp \
	himalayaoption.cpp \
	hybridhestonhullwhiteprocess.cpp \
	indexes.cpp \
	inflation.cpp \
	inflationcapfloor.cpp \
	inflationcapflooredcoupon.cpp \
	inflationcpibond.cpp \
	inflationcpicapfloor.cpp \
	inflationcpiswap.cpp \
	inflationvolatility.cpp \
	instruments.cpp \
	integrals.cpp \
	interestrates.cpp \
	interpolations.cpp \
	jumpdiffusion.cpp \
	lazyobject.cpp \
	libormarketmodel.cpp \
	libormarketmodelprocess.cpp \
	linearleastsquaresregression.cpp \
	lookbackoptions.cpp \
	lowdiscrepancysequences.cpp \
	margrabeoption.cpp \
	marketmodel.cpp \
	marketmodel_cms.cpp \
	marketmodel_smm.cpp \
	marketmodel_smmcapletalphacalibration.cpp \
	marketmodel_smmcapletcalibration.cpp \
	marketmodel_smmcaplethomocalibration.cpp \
	markovfunctional.cpp \
	matrices.cpp \
	mclongstaffschwartzengine.cpp \
	mersennetwister.cpp \
	money.cpp \
	noarbsabr.cpp \
	normalclvmodel.cpp \
	nthorderderivativeop.cpp \
	nthtodefault.cpp \
	numericaldifferentiation.cpp \
	observable.cpp \
	ode.cpp \
	operators.cpp \
	optimizers.cpp \
	optionletstripper.cpp \
	overnightindexedcoupon.cpp \
	overnightindexedswap.cpp \
	pagodaoption.cpp \
	partialtimebarrieroption.cpp \
	pathgenerator.cpp \
	period.cpp \
	piecewiseyieldcurve.cpp \
	piecewisezerospreadedtermstructure.cpp \
	quantooption.cpp \
	quotes.cpp \
	rangeaccrual.cpp \
	riskneutraldensitycalculator.cpp \
	riskstats.cpp \
	rngtraits.cpp \
	rounding.cpp \
	sampledcurve.cpp \
	schedule.cpp \
	settings.cpp \
	shortratemodels.cpp \
	sofrfutures.cpp \
	solvers.cpp \
	spreadoption.cpp \
	squarerootclvmodel.cpp \
	stats.cpp \
	subperiodcoupons.cpp \
	svivolatility.cpp \
	swap.cpp \
	swapforwardmappings.cpp \
	swaption.cpp \
	swaptionvolatilitycube.cpp \
	swaptionvolatilitymatrix.cpp \
	swingoption.cpp \
	termstructures.cpp \
	timegrid.cpp \
	timeseries.cpp \
	transformedgrid.cpp \
	tqreigendecomposition.cpp \
	tracing.cpp \
	twoassetbarrieroption.cpp \
	twoassetcorrelationoption.cpp \
	ultimateforwardtermstructure.cpp \
	utilities.cpp \
	variancegamma.cpp \
	varianceoption.cpp \
	varianceswaps.cpp \
	volatilitymodels.cpp \
	vpp.cpp \
	zabr.cpp \
	zerocouponswap.cpp

QL_TEST_HDRS = \
	speedlevel.hpp \
	americanoption.hpp \
	amortizingbond.hpp \
	andreasenhugevolatilityinterpl.hpp \
	array.hpp \
	asianoptions.hpp \
	assetswap.hpp \
	autocovariances.hpp \
	barrieroption.hpp \
	binaryoption.hpp \
	basismodels.hpp \
	basisswapratehelpers.hpp \
	basketoption.hpp \
	batesmodel.hpp \
	bermudanswaption.hpp \
	blackdeltacalculator.hpp \
	blackformula.hpp \
	bondforward.hpp \
	bonds.hpp \
	brownianbridge.hpp \
	businessdayconventions.hpp \
	calendars.hpp \
	callablebonds.hpp \
	capfloor.hpp \
	capflooredcoupon.hpp \
	cashflows.hpp \
	catbonds.hpp \
	cdo.hpp \
	cdsoption.hpp \
	chooseroption.hpp \
	cliquetoption.hpp \
	cms.hpp \
	cmsspread.hpp \
	commodityunitofmeasure.hpp \
	compiledboostversion.hpp \
	compoundoption.hpp \
	convertiblebonds.hpp \
	covariance.hpp \
	creditdefaultswap.hpp \
	creditriskplus.hpp \
	crosscurrencyratehelpers.hpp \
	currency.hpp \
	curvestates.hpp \
	dates.hpp \
	daycounters.hpp \
	defaultprobabilitycurves.hpp \
	digitalcoupon.hpp \
	digitaloption.hpp \
	distributions.hpp \
	dividendoption.hpp \
	doublebarrieroption.hpp \
	doublebinaryoption.hpp \
	europeanoption.hpp \
	everestoption.hpp \
	exchangerate.hpp \
	extendedtrees.hpp \
	extensibleoptions.hpp \
	fastfouriertransform.hpp \
	fdheston.hpp \
	fdcir.hpp \
	fdmlinearop.hpp \
	fdcev.hpp \
	fdsabr.hpp \
	fittedbonddiscountcurve.hpp \
	forwardoption.hpp \
	forwardrateagreement.hpp \
	functions.hpp \
	garch.hpp \
	gaussianquadratures.hpp \
	gjrgarchmodel.hpp \
	gsr.hpp \
	hestonmodel.hpp \
	hestonslvmodel.hpp \
	himalayaoption.hpp \
	hybridhestonhullwhiteprocess.hpp \
	indexes.hpp \
	inflation.hpp \
	inflationcapfloor.hpp \
	inflationcapflooredcoupon.hpp \
	inflationcpibond.hpp \
	inflationcpicapfloor.hpp \
	inflationcpiswap.hpp \
	inflationvolatility.hpp \
	instruments.hpp \
	integrals.hpp \
	interestrates.hpp \
	interpolations.hpp \
	jumpdiffusion.hpp \
	lazyobject.hpp \
	libormarketmodel.hpp \
	libormarketmodelprocess.hpp \
	linearleastsquaresregression.hpp \
	lookbackoptions.hpp \
	lowdiscrepancysequences.hpp \
	margrabeoption.hpp \
	marketmodel.hpp \
	marketmodel_cms.hpp \
	marketmodel_smm.hpp \
	marketmodel_smmcapletalphacalibration.hpp \
	marketmodel_smmcapletcalibration.hpp \
	marketmodel_smmcaplethomocalibration.hpp \
	markovfunctional.hpp \
	matrices.hpp \
	mclongstaffschwartzengine.hpp \
	mersennetwister.hpp \
	money.hpp \
	noarbsabr.hpp \
	normalclvmodel.hpp \
	nthorderderivativeop.hpp \
	nthtodefault.hpp \
	numericaldifferentiation.hpp \
	observable.hpp \
	ode.hpp \
	operators.hpp \
	optimizers.hpp \
	optionletstripper.hpp \
	overnightindexedcoupon.hpp \
	overnightindexedswap.hpp \
	pagodaoption.hpp \
	partialtimebarrieroption.hpp \
	pathgenerator.hpp \
	period.hpp \
	piecewiseyieldcurve.hpp \
	piecewisezerospreadedtermstructure.hpp \
	quantooption.hpp \
	quotes.hpp \
	rangeaccrual.hpp \
	riskneutraldensitycalculator.hpp \
	riskstats.hpp \
	rngtraits.hpp \
	rounding.hpp \
	sampledcurve.hpp \
	schedule.hpp \
	settings.hpp \
	shortratemodels.hpp \
	sofrfutures.hpp \
	solvers.hpp \
	spreadoption.hpp \
	squarerootclvmodel.hpp \
	stats.hpp \
	subperiodcoupons.hpp \
	svivolatility.hpp \
	swap.hpp \
	swapforwardmappings.hpp \
	swaption.hpp \
	swaptionvolatilitycube.hpp \
	swaptionvolatilitymatrix.hpp \
	swaptionvolstructuresutilities.hpp \
	swingoption.hpp \
	termstructures.hpp \
	timegrid.hpp \
	timeseries.hpp \
	transformedgrid.hpp \
	tqreigendecomposition.hpp \
	tracing.hpp \
	twoassetbarrieroption.hpp \
	twoassetcorrelationoption.hpp \
	ultimateforwardtermstructure.hpp \
	utilities.hpp \
	variancegamma.hpp \
	varianceoption.hpp \
	varianceswaps.hpp \
	volatilitymodels.hpp \
	vpp.hpp \
	zabr.hpp \
	zerocouponswap.hpp

QL_TESTS = ${QL_TEST_SRCS} ${QL_TEST_HDRS}

QL_BENCHMARK_SRCS = \
	quantlibbenchmark.cpp \
	americanoption.cpp \
	asianoptions.cpp \
	barrieroption.cpp \
	doublebarrieroption.cpp \
	basketoption.cpp \
	batesmodel.cpp \
	convertiblebonds.cpp \
	digitaloption.cpp \
	dividendoption.cpp \
	europeanoption.cpp \
	fdheston.cpp \
	hestonmodel.cpp \
	interpolations.cpp \
	jumpdiffusion.cpp \
	lowdiscrepancysequences.cpp \
	marketmodel_cms.cpp \
	marketmodel_smm.cpp \
	quantooption.cpp \
	riskstats.cpp \
	shortratemodels.cpp \
	utilities.cpp

QL_BENCHMARK_HDRS = \
	americanoption.hpp \
	asianoptions.hpp \
	barrieroption.hpp \
	doublebarrieroption.hpp \
	basketoption.hpp \
	batesmodel.hpp \
	convertiblebonds.hpp \
	digitaloption.hpp \
	dividendoption.hpp \
	europeanoption.hpp \
	fdheston.hpp \
	hestonmodel.hpp \
	interpolations.hpp \
	jumpdiffusion.hpp \
	lowdiscrepancysequences.hpp \
	marketmodel_cms.hpp \
	marketmodel_smm.hpp \
	quantooption.hpp \
	riskstats.hpp \
	shortratemodels.hpp \
	utilities.hpp

QL_BENCHMARKS = ${QL_BENCHMARK_SRCS} ${QL_BENCHMARK_HDRS}

dist-hook:
	mkdir -p $(distdir)/build
	mkdir -p $(distdir)/bin
	cp -p $(srcdir)/bin/runtest.bat $(distdir)/bin

if BUILD_TEST_SUITE

AM_CPPFLAGS = -I${top_builddir} -I${top_srcdir}

noinst_LTLIBRARIES = libUnitMain.la
libUnitMain_la_SOURCES = main.cpp
libUnitMain_la_CXXFLAGS = ${BOOST_UNIT_TEST_MAIN_CXXFLAGS}

if AUTO_BENCHMARK
bin_PROGRAMS = quantlib-test-suite quantlib-benchmark
else
bin_PROGRAMS = quantlib-test-suite
noinst_PROGRAMS = quantlib-benchmark
endif

if UNITY_BUILD

nodist_quantlib_test_suite_SOURCES = unity_test.cpp

unity_test.cpp: Makefile.am
	echo "/* This file is automatically generated; do not edit.     */" > $@
	echo "/* Add the files to be included into Makefile.am instead. */" >> $@
	echo >> $@
	for i in $(QL_TEST_SRCS); do \
		echo "#include \"test-suite/$$i\"" >> $@; \
	done

nodist_quantlib_benchmark_SOURCES = unity_benchmark.cpp

unity_benchmark.cpp: Makefile.am
	echo "/* This file is automatically generated; do not edit.     */" > $@
	echo "/* Add the files to be included into Makefile.am instead. */" >> $@
	echo >> $@
	for i in $(QL_BENCHMARK_SRCS); do \
		echo "#include \"test-suite/$$i\"" >> $@; \
	done

EXTRA_DIST = $(QL_TESTS) $(QL_BENCHMARKS)

else

quantlib_test_suite_SOURCES = $(QL_TESTS)

quantlib_benchmark_SOURCES = $(QL_BENCHMARKS)

EXTRA_DIST =

endif

quantlib_test_suite_LDADD = libUnitMain.la ${top_builddir}/ql/libQuantLib.la \
                            ${PTHREAD_LIB} ${BOOST_INTERPROCESS_LIB}

quantlib_benchmark_LDADD = libUnitMain.la ${top_builddir}/ql/libQuantLib.la \
                           ${PTHREAD_LIB}

TESTS = quantlib-test-suite$(EXEEXT)
TESTS_ENVIRONMENT = BOOST_TEST_LOG_LEVEL=message BOOST_TEST_COLOR_OUTPUT=false

.PHONY: benchmark
benchmark: quantlib-benchmark$(EXEEXT)
	BOOST_TEST_LOG_LEVEL=message ./quantlib-benchmark$(EXEEXT)

EXTRA_DIST += \
	CMakeLists.txt \
	paralleltestrunner.hpp \
	README.txt \
	testsuite.vcxproj \
	testsuite.vcxproj.filters

else

EXTRA_DIST = \
	${QL_TESTS} \
	CMakeLists.txt \
	paralleltestrunner.hpp \
	quantlibbenchmark.cpp \
	README.txt \
	testsuite.vcxproj \
	testsuite.vcxproj.filters

endif
